package com.gsnd.gsnd21study.web;

import com.gsnd.gsnd21study.entity.DRO.RoleAndUser;
import com.gsnd.gsnd21study.service.SysRoleService;
import com.gsnd.gsnd21study.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/role")
public class SysRoleController {

    @Autowired
    SysRoleService roleService;

    @GetMapping("/au/{roleId}")
    public Result<RoleAndUser> getRoleAndUserByRoleId(@PathVariable Long roleId){
        RoleAndUser ru = roleService.getRoleAndUserByRoleId(roleId);
        return Result.success(ru);
    }

}
